package com.zzl.ov_library.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName borrow_record
 */
@TableName(value ="borrow_record")
@Data
public class BorrowRecord implements Serializable {
    /**
     * 
     */
    @TableId(value = "record_id", type = IdType.AUTO)
    private Integer recordId;

    /**
     * 
     */
    @TableField(value = "user_id")
    private Integer userId;

    /**
     * 
     */
    @TableField(value = "book_id")
    private Integer bookId;

    /**
     * 
     */
    @TableField(value = "branch_id_borrow")
    private Integer branchIdBorrow;

    /**
     * 
     */
    @TableField(value = "branch_id_return")
    private Integer branchIdReturn;

    /**
     * 借书时间
     */
    @TableField(value = "borrow_time")
    private Date borrowTime;

    /**
     * 应还时间
     */
    @TableField(value = "due_time")
    private Date dueTime;

    /**
     * 实际归还时间
     */
    @TableField(value = "return_time")
    private Date returnTime;

    /**
     * 续借次数
     */
    @TableField(value = "renew_count")
    private Integer renewCount;

    /**
     * 借阅状态
     */
    @TableField(value = "status")
    private Object status;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        BorrowRecord other = (BorrowRecord) that;
        return (this.getRecordId() == null ? other.getRecordId() == null : this.getRecordId().equals(other.getRecordId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getBookId() == null ? other.getBookId() == null : this.getBookId().equals(other.getBookId()))
            && (this.getBranchIdBorrow() == null ? other.getBranchIdBorrow() == null : this.getBranchIdBorrow().equals(other.getBranchIdBorrow()))
            && (this.getBranchIdReturn() == null ? other.getBranchIdReturn() == null : this.getBranchIdReturn().equals(other.getBranchIdReturn()))
            && (this.getBorrowTime() == null ? other.getBorrowTime() == null : this.getBorrowTime().equals(other.getBorrowTime()))
            && (this.getDueTime() == null ? other.getDueTime() == null : this.getDueTime().equals(other.getDueTime()))
            && (this.getReturnTime() == null ? other.getReturnTime() == null : this.getReturnTime().equals(other.getReturnTime()))
            && (this.getRenewCount() == null ? other.getRenewCount() == null : this.getRenewCount().equals(other.getRenewCount()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getRecordId() == null) ? 0 : getRecordId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getBookId() == null) ? 0 : getBookId().hashCode());
        result = prime * result + ((getBranchIdBorrow() == null) ? 0 : getBranchIdBorrow().hashCode());
        result = prime * result + ((getBranchIdReturn() == null) ? 0 : getBranchIdReturn().hashCode());
        result = prime * result + ((getBorrowTime() == null) ? 0 : getBorrowTime().hashCode());
        result = prime * result + ((getDueTime() == null) ? 0 : getDueTime().hashCode());
        result = prime * result + ((getReturnTime() == null) ? 0 : getReturnTime().hashCode());
        result = prime * result + ((getRenewCount() == null) ? 0 : getRenewCount().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", recordId=").append(recordId);
        sb.append(", userId=").append(userId);
        sb.append(", bookId=").append(bookId);
        sb.append(", branchIdBorrow=").append(branchIdBorrow);
        sb.append(", branchIdReturn=").append(branchIdReturn);
        sb.append(", borrowTime=").append(borrowTime);
        sb.append(", dueTime=").append(dueTime);
        sb.append(", returnTime=").append(returnTime);
        sb.append(", renewCount=").append(renewCount);
        sb.append(", status=").append(status);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}